package huian.lee.entity.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the userinfo table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="userinfo"
 */

public abstract class BaseUserinfo  implements Serializable {

	public static String REF = "Userinfo";
	public static String PROP_EMAIL = "email";
	public static String PROP_PASSWORD = "password";
	public static String PROP_USERNAME = "username";
	public static String PROP_ID = "id";
	public static String PROP_ENDTIME = "endtime";
	public static String PROP_MEMBERSTATUS = "memberstatus";


	// constructors
	public BaseUserinfo () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseUserinfo (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.lang.String username;
	private java.lang.String password;
	private java.lang.String email;
	private java.lang.Integer memberstatus;
	private java.util.Date endtime;

	// collections
	private java.util.Set<huian.lee.entity.Shopinfo> shopinfos;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="identity"
     *  column="id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: username
	 */
	public java.lang.String getUsername () {
		return username;
	}

	/**
	 * Set the value related to the column: username
	 * @param username the username value
	 */
	public void setUsername (java.lang.String username) {
		this.username = username;
	}



	/**
	 * Return the value associated with the column: password
	 */
	public java.lang.String getPassword () {
		return password;
	}

	/**
	 * Set the value related to the column: password
	 * @param password the password value
	 */
	public void setPassword (java.lang.String password) {
		this.password = password;
	}



	/**
	 * Return the value associated with the column: email
	 */
	public java.lang.String getEmail () {
		return email;
	}

	/**
	 * Set the value related to the column: email
	 * @param email the email value
	 */
	public void setEmail (java.lang.String email) {
		this.email = email;
	}



	/**
	 * Return the value associated with the column: memberstatus
	 */
	public java.lang.Integer getMemberstatus () {
		return memberstatus;
	}

	/**
	 * Set the value related to the column: memberstatus
	 * @param memberstatus the memberstatus value
	 */
	public void setMemberstatus (java.lang.Integer memberstatus) {
		this.memberstatus = memberstatus;
	}



	/**
	 * Return the value associated with the column: endtime
	 */
	public java.util.Date getEndtime () {
		return endtime;
	}

	/**
	 * Set the value related to the column: endtime
	 * @param endtime the endtime value
	 */
	public void setEndtime (java.util.Date endtime) {
		this.endtime = endtime;
	}



	/**
	 * Return the value associated with the column: shopinfos
	 */
	public java.util.Set<huian.lee.entity.Shopinfo> getShopinfos () {
		return shopinfos;
	}

	/**
	 * Set the value related to the column: shopinfos
	 * @param shopinfos the shopinfos value
	 */
	public void setShopinfos (java.util.Set<huian.lee.entity.Shopinfo> shopinfos) {
		this.shopinfos = shopinfos;
	}

	public void addToshopinfos (huian.lee.entity.Shopinfo shopinfo) {
		if (null == getShopinfos()) setShopinfos(new java.util.TreeSet<huian.lee.entity.Shopinfo>());
		getShopinfos().add(shopinfo);
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof huian.lee.entity.Userinfo)) return false;
		else {
			huian.lee.entity.Userinfo userinfo = (huian.lee.entity.Userinfo) obj;
			if (null == this.getId() || null == userinfo.getId()) return false;
			else return (this.getId().equals(userinfo.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}